import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: mirac
 * Date: 2025-04-17
 * Time: 20:56
 */
public class main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int x = scanner.nextInt();
        int count = 0;
        while(x != 0){
            count++;
            x &= (x-1);
        }
        System.out.println(count);
    }
}
